/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client.process;

import java.io.File;
import java.util.ArrayList;

/**
 *
 * @author ifan
 */
public class GlobalProcess {

    public static int defaultInterval = 10;
    public static String defaultRepository = "D:/kurakura";

    public static ArrayList<File> getListDir(String path) {
        ArrayList<File> dirs = new ArrayList<File>();
        File file = new File(path);
        File[] files = file.listFiles();
        for(int i=0;i<files.length;++i) {
            if(files[i].isDirectory()){
                dirs.add(files[i]);
            }
        }

        return dirs;
    }

    public static ArrayList<File> getListFile(String path) {
        ArrayList<File> listFile = new ArrayList<File>();
        File file = new File(path);
        File[] files = file.listFiles();
        for(int i=0;i<files.length;++i) {
            if(files[i].isFile()){
                listFile.add(files[i]);
            }
        }

        return listFile;
    }
}
